package com.kyzh.core.adapters

import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.kyzh.core.R
import org.jetbrains.anko.textColor

// 只带边框的
class BiaoqianAdapter(data :ArrayList<String> ) : BaseQuickAdapter<String, BaseViewHolder>(R.layout.item_textview,data){
    override fun convert(holder: BaseViewHolder, item: String) {
        val view = holder.getView<TextView>(R.id.tvTags)
        view.apply {
            text = item
            when(holder.layoutPosition){
                0 ->{
                    background = context.resources.getDrawable(R.drawable.bq1)
                    textColor = context.resources.getColor(R.color.bq1)
                }
                1 ->{
                    background = context.resources.getDrawable(R.drawable.bq2)
                    textColor = context.resources.getColor(R.color.bq2)
                }
                2 ->{
                    background = context.resources.getDrawable(R.drawable.bq3)
                    textColor = context.resources.getColor(R.color.bq3)
                }
                3 ->{
                    background = context.resources.getDrawable(R.drawable.bq4)
                    textColor = context.resources.getColor(R.color.bq4)
                }
                4 ->{
                    background = context.resources.getDrawable(R.drawable.bq5)
                    textColor = context.resources.getColor(R.color.bq5)
                }
                else ->{
                    background = context.resources.getDrawable(R.drawable.bq1)
                    textColor = context.resources.getColor(R.color.bq1)
                }
            }
        }
    }
}